package com.sskj.gocoinapp.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.gocoinapp.http.HttpConfig;
import com.sskj.gocoinapp.ui.activity.RegisterNextActivity;
import com.sskj.lib.http.JsonCallBack;


public class RegisterNextActivityPresenter extends BasePresenter<RegisterNextActivity> {

    public void register(String code, String pwd, String inviteCode) {

    }

    /**
     * 注册
     *
     * @param mobile 手机号/邮箱号
     * @param code   验证码
     * @param opwd   密码
     * @param opwd1  重复密码
     * @param tjuser 推荐码/邀请码
     * @return
     */
    public void register(String mobile, String code, String opwd, String opwd1, String tjuser) {
        httpService.register(mobile, code, opwd, opwd1, tjuser).execute(new JsonCallBack<HttpData>(this) {
            @Override
            public void onSuccess(Response<HttpData> response) {
                HttpData httpData = response.body();
                if (httpData.getStatus() == HttpConfig.OK) {
                    mView.registerSuccess();
                }
            }
        });
    }
}
